Exploring & Visualising Australian Historical Temperature Data in Python

After enduring the hottest Australian summer on record in 2019/20 sheltered inside with air-con and air purifier running as large parts of my home state of New South Wales burned, I decided to run some exploratory analysis on the Bureau of Meteorology's fantastic ACORN-SAT 2.1 database.

The Australian Climate Observations Reference Network – Surface Air Temperature (ACORN-SAT) is the dataset used by the Bureau of Meteorology to monitor long-term temperature trends in Australia. ACORN-SAT uses observations from 112 weather stations in all corners of Australia, selected for the quality and length of their available temperature data.

Setup

Let's get started by importing the required packages

Some Plotly visualisations require a Mapbox account - you can register for the basic account tier for free.

We then create a dataframe from a CSV containing a list of weather station names and locations

The dataset of temperature readings comes split into 'max' and 'min' folders containing a CSV for each weather station. The below code loops through each CSV, creating a dataframe for each station and running some pre-processing, before concatenating them together.

Exploring the Australian Bureau of Meteorology data

We start by printing some basic statistics describing the dataset

There are a not insignificant number of missing values in this dataset, however given we are exploring mean temperature values this is not especially critical.

Visualising Extreme Heat Events

These are the days when you just can't afford for your air-con to break. When koalas come down from their gum trees for a swim in the billabong. Using the BoM dataset let's find out where in Australia you would be better off living underground, and whether the occurences of 40°C+ (104 °F) are on the rise.

Hottest Places in Australia (2019)

Let's start by finding the Australian locations with the most days of extreme heat (40°C / 104 °F) in 2019

The fact Marble Bar (located in Western Australia) is at the top of this list shouldn't be a surprise. Marble Bar has a hot desert climate with sweltering summers and warm winters. Most of the annual rainfall occurs in the summer. The town set a world record of most consecutive days of 100 °F (37.8 °C) or above, during a period of 160 days from 31 October 1923 to 7 April 1924.

Occurence of Extreme Weather Events Over Time

Let's look at whether the number of days over 40°C (104 °F) has increased over time.

Visualising this data, it appears that there is indeed an upward trend showing increasing extreme weather events across Australia

Visualising Temperature Data By Season

Given that there seems to be an increasing trend of extreme weather events, let's explore the averaged temperature data in more detail and whether there is any discernable difference between Summer & Winter records

In addition to the data from the Australian Bureau of Meteorology, I've added a dataframe with cold & warm episodes by season from the National Weather Service to identify when El Nino & La Nina events are occurring and the Oceanic Niño Index (ONI) score.

Visualising Seasonal Average Daily Temperature

We can now create scatterplots showing average daily temperatures for Summer and for Winter, colour-coded with the ONI data. Red indicates an El Nino event and blue indicates La Nina.

Temperatures in Summer & Winter have both increased by approximately 1.5°C since 1950, which is also reflected in the number of extreme heat events in the previous section. The data shows that although there is no apparently correlation between ONI and temperature in Winter, Summer El Nino events appear to be correlated with with higher than average temperatures (record heat in 1973, 1983, 1997 & 2019-20 was driven by strong El Nino events), and likewise La Nina events often bring lower than average temperatures (1974-76, 1984, 2000 & 2011-12).

Visualising Average Daily Temperature Range

Using the same dataframe, we can assess whether the increase in temperatures is likely to bring about an increased daily temperature range (i.e. colder nights, hotter days) across the BoM weather station locations.

The trendlines show a very slight increase in the average daily temperature range between 1950-2020, leading to approximately 0.5°C greater difference between min / max temperatures in both Summer & Winter.

Geospatial Historical Temperature Analysis

Given we have the coordinates of weather stations Australia-wide, let's create an animated map showing temperature changes over time.

It's easy to create animations with Plotly's Mapbox integration. For some of the Mapbox style types (like "satellite" used here), you'll need a mapbox access token which can be obtained by registering for free.